﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;

namespace BusinessObjects
{
#if Silverlight
    [Serializable]
#else
    [DataContract]
#endif
    public class MoveMessage : BaseBusinessObject
    {
        private MoveDirection moveDirection;
        private int steps;
        private GameObject payload;
        private int playerId;

        private double x;
        private double y;

        [DataMember]
        public double X
        {
            get
            {
                return this.x;
            }
            set
            {
                if ( this.x != value )
                    this.x = value;
            }
        }

        [DataMember]
        public double Y
        {
            get
            {
                return this.y;
            }
            set
            {
                if ( this.y != value )
                    this.y = value;
            }
        }

        [DataMember]
        public GameObject Payload
        {
            get
            {
                return this.payload;
            }
            set
            {
                if ( this.payload != value )
                {
                    this.payload = value;
                    this.NotifyPropertyChanged( "Payload" );
                }
            }
        }

        [DataMember]
        public MoveDirection MoveDirection
        {
            get
            {
                return this.moveDirection;
            }
            set
            {
                if ( this.moveDirection != value )
                {
                    this.moveDirection = value;
                    this.NotifyPropertyChanged( "MoveDirection" );
                }
            }
        }

        [DataMember]
        public int Steps
        {
            get
            {
                return this.steps;
            }
            set
            {
                if ( this.steps != value )
                {
                    this.steps = value;
                    this.NotifyPropertyChanged( "Steps" );
                }
            }
        }

        [DataMember]
        public int PlayerId
        {
            get
            {
                return this.playerId;
            }
            set
            {
                if ( this.playerId == value )
                    return;

                this.playerId = value;
                this.NotifyPropertyChanged( "PlayerId" );
            }
        }
    }
}